import { ref } from 'vue';
// storeId: '',
// parentId: '',
// ancestors: '',
// storeName: '',
// storeAbbreviation: '',
// storeCode: '',
// storeType: '1',
// storeLb: roles.includes('headquartersAdmin') ? '3' : '1', 
// remark: '',
// isStatus: '0',
// businessTime: '08:30',
// closeTime: '17:30',
// storePastdueTime: '',
// remindMp3: '',
// restrictAdduserCount: '',
// generateSide: '',
// address: '',
// contactInformation: '',
// orderNum: 0,
// productlibraryId: '',
// printerKey: [],
// stalePastdueDdmessagelocation:'',
// stalePastdueFsmessagelocation:'',
// stalePastdueQwmessagelocation:''

export default function useStore() {
	const rules = ref({
		parentId: [
			{
				required: true,
				message: '上级门店不能为空',
				trigger: 'blur',
			},
		],
		printerKey: [
			{
				required: true,
				message: '打印机不能为空',
				trigger: 'blur',
			},
		],
		productlibraryId: [
			{
				required: true,
				message: '产品库不能为空',
				trigger: 'blur',
			},
		],
		storeName: [
			{
				required: true,
				message: '名称不能为空',
				trigger: 'blur',
			},
		],
		address: [
			{
				required: true,
				message: '地址不能为空',
				trigger: 'blur',
			},
		],
		storeAbbreviation: [
			{
				required: true,
				message: '地址不能为空',
				trigger: 'blur',
			},
		],
		contactInformation: [
			// {
			// 	required: true,
			// 	message: '手机号码不能为空',
			// 	trigger: 'blur',
			// },
			{
				pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
				message: '请输入正确的手机号码',
				trigger: 'blur',
			},
		],
	});
	return {
		rules
	};
}